package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name="耿梦蕾";
        int age=22;
        String gender="男";
        String[]otherInfo={"是一名学生","衡水的","喜欢打羽毛球"};
        Student stu=new Student(name,age,gender,otherInfo);
        System.out.println(stu);
        FileOutputStream fos=new FileOutputStream("student.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(stu);
        oos.close();
    }
}
